home *** CD-ROM | disk | FTP | other *** search
Wrap
Java Source | 1998-10-26 | 5.7 KB | 125 lines
package com.symantec.itools.swing; import java.beans.*; import java.util.ResourceBundle; import com.symantec.itools.swing.DesignTimeResourceBundle; import com.symantec.itools.vcafe.beans.*; import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes; // 08/19/98 LAB Moved to GroupAWTAdditions folder. // 10/06/98 VJ Added code for grouping together currency properties public class JCurrencyTextFieldBeanInfo extends com.symantec.itools.beans.HelperBeanInfo { public JCurrencyTextFieldBeanInfo() { setInheritSuperBeanInfo(true); ResourceBundle resources = ResourceBundle.getBundle("com.symantec.itools.swing.DesignTimeResourceBundle"); String folderName = resources.getString(DesignTimeResourceBundle.SWING_ADDITIONS_FOLDER_TOOLBAR_KEY); setComponentLibraryFolder(folderName); setToolbarFolder(folderName); setWinHelpKey(m_WinHelpID); } protected Class getBeanClass() { return JCurrencyTextField.class; } /** * Gets an image that may be used to visually represent this bean * (in the toolbar, on a form, etc). * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16, * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32. * @return an image for this bean, always color even if requested monochrome * @see BeanInfo#ICON_MONO_16x16 * @see BeanInfo#ICON_COLOR_16x16 * @see BeanInfo#ICON_MONO_32x32 * @see BeanInfo#ICON_COLOR_32x32 */ public java.awt.Image getIcon(int iconKind) { java.awt.Image img = null; switch (iconKind) { case BeanInfo.ICON_MONO_16x16: case BeanInfo.ICON_COLOR_16x16: img = loadImage("jcurrency16.gif"); break; case BeanInfo.ICON_MONO_32x32: case BeanInfo.ICON_COLOR_32x32: img = loadImage("jcurrency32.gif"); } return img; } //VJ start public PropertyDescriptor[] getPropertyDescriptors() { try{ /* DataText should not be exposed - Puru (10/26/98) PropertyDescriptor dataText = new PropertyDescriptor("dataText", getBeanClass(),"getDataText",null); dataText.setBound(false); dataText.setConstrained(false); dataText.setDisplayName("Data Text"); dataText.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); dataText.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DATA_TEXT_HELP_ID)); */ PropertyDescriptor decimalPoint = new PropertyDescriptor("decimalPoint", getBeanClass()); decimalPoint.setBound(false); decimalPoint.setConstrained(false); decimalPoint.setDisplayName("Decimal Point"); decimalPoint.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); decimalPoint.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DECIMAL_POINT_HELP_ID)); PropertyDescriptor digitsAfterDecimal = new PropertyDescriptor("digitsAfterDecimal", getBeanClass()); digitsAfterDecimal.setBound(false); digitsAfterDecimal.setConstrained(false); digitsAfterDecimal.setDisplayName("Digits After Decimal"); digitsAfterDecimal.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); digitsAfterDecimal.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DIGITS_AFTER_DECIMAL_HELP_ID)); PropertyDescriptor currencyLeading = new PropertyDescriptor("currencyLeading", getBeanClass()); currencyLeading.setBound(false); currencyLeading.setConstrained(false); currencyLeading.setDisplayName("Leading Symbol"); currencyLeading.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); currencyLeading.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_LEADING_SYMBOL_HELP_ID)); PropertyDescriptor separator = new PropertyDescriptor("separator", getBeanClass()); separator.setBound(false); separator.setConstrained(false); separator.setDisplayName("Separator"); separator.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); separator.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_HELP_ID)); PropertyDescriptor separatorEnabled = new PropertyDescriptor("separatorEnabled", getBeanClass()); separatorEnabled.setBound(false); separatorEnabled.setConstrained(false); separatorEnabled.setDisplayName("Separator Enabled"); separatorEnabled.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); separatorEnabled.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_ENABLED_HELP_ID)); PropertyDescriptor currencySymbol = new PropertyDescriptor("currencySymbol", getBeanClass()); currencySymbol.setBound(false); currencySymbol.setConstrained(false); currencySymbol.setDisplayName("Symbol"); currencySymbol.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency"); currencySymbol.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SYMBOL_HELP_ID)); PropertyDescriptor document = new PropertyDescriptor ("document", getBeanClass ()); document.setHidden (true); PropertyDescriptor[] rv = {currencySymbol,currencyLeading,decimalPoint,digitsAfterDecimal, separator,separatorEnabled,document}; return rv; } catch (IntrospectionException e) { throw new Error(e.toString()); } } //VJ end protected final static String m_WinHelpID = "0x600FC"; }